﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace ch04
{
    public partial class Form5 : Form
    {
        string movieName;
        public Form5()
        {
            InitializeComponent();
        }
        //带参构建方法,接收电影名称
        public Form5(string movieName)
        {
            InitializeComponent();
            this.movieName = movieName;
        }

        private void Form5_Load(object sender, EventArgs e)
        {
            pictureBox1.Image = Image.FromFile(@"影视\"+ movieName+ ".jpg");

            string fileName = @"影视\" + movieName + ".txt";

            StreamReader sr = new StreamReader(fileName, Encoding.Default);

            label1.Text = "电影名称:" + fileName;
            label2.Text = "上映日期:" + fileName;
            label3.Text = "类型:" + fileName;
            label4.Text = "演员:" + fileName;
        }
    }
}
